<form id="form-category">
	<table border="0" class="bread-crumb">
		<tr>
			<td style="padding-left:8px;"><?php echo $this->partial('breadcrum-menu.phtml', array('new_orders' => $this->new_orders, 'id_store' => $this->store->id)) ?></td>
			<td style="padding-right:0px;text-align: right;">
                <a id="btn-create" href="javascript:void(0);" class="underline">
                    <img class="bordernone" src="img/icon_category.png" height="11" width="11" /> <?php echo $this->translate('BUTTON_CREATE_ROOT_CATEGORY') ?>
                </a>
            </td>
            <td style="text-align: right;">
                <a class="underline non_space" href="<?php echo $this->url(array('module' => 'store','controller' => 'product', 'action' => 'create', 'id_store' => $this->store->id), null, true); ?>">
                    <img src="img/add.png" class="bordernone" height="11" width="11" /><?php echo $this->translate('NEW_PRODUCT_LABEL') ?>
                </a>
            </td>
		</tr>
	</table>
	<?php if (count($this->messages)) : ?>
	<div class="ms_message">
		<?php foreach ($this->messages as $message) : ?>
			<?php echo $this->translate($message); ?>
		<?php endforeach; ?>
	</div>
	<?php endif; ?>
	<?php $arrCategories = $this->store->getCategoryHierarchy(false);?>
	<?php if( !empty($arrCategories) ): ?>	
		<?php echo $this->categoryBuilder($arrCategories);?>
	<?php else:?>
	<div class="sm_paginator_item_empty">
		<?php echo $this->translate('NO_CATEGORY_AVAILABLE')?>
		-
		<a href="javascript:void(0);" onclick="$('#btn-create').click();">
			<?php echo $this->translate('BUTTON_CREATE_ROOT_CATEGORY') ?>	
		</a>
	</div>
	<?php endif;?>
</form>
<script type="text/javascript">	
	$("#form-category").ymFormCategory(
		{
			'label': {
				'title-create': '<?php echo $this->translate('CATEGORY_CREATE') ?>',
				'title-confirm': '<?php echo $this->translate('MESSAGE_CONFIRM') ?>',
				'title-edit': '<?php echo $this->translate('CATEGORY_UPDATE') ?>',
				'category-root': '<?php echo $this->translate('CATEGORY_ROOT') ?>',
				'sortable-waiting': '<?php echo $this->translate('MSG_SORT_CATEGORY_WAITING') ?>',
				'sortable-successful': '<?php echo $this->translate('MSG_SORT_CATEGORY_SUCCESSFUL') ?>'
			},
			'delete-url': '<?php echo $this->url(array('action' => 'delete'))?>',
			'move-url': '<?php echo $this->url(array('module' => 'store', 'controller' => 'category', 'action' => 'move','id_store' => $this->store->id),'', true)?>',
			'create-form-template': '<?php echo YouNet_Util::htmlToJs($this->partial('category/template/create-form-template.phtml',array('store' => $this->store)))?>',
			'update-form-template': '<?php echo YouNet_Util::htmlToJs($this->partial('category/template/update-form-template.phtml',array('store' => $this->store)))?>',
			'confirm-delete-template': '<?php echo YouNet_Util::htmlToJs($this->partial('category/template/confirm-detele.phtml',array('store' => $this->store)))?>'
		}
	);
	addTab("<?php echo Core_Util::escapeForJS($this->store->getName()) ?>",'<?php echo $this->url(array('controller' => 'product','action' => 'list'))?>');
</script>

